package com.kristin.dubbo.client;

import com.kristin.dubbo.service.GreetingService;
import org.apache.dubbo.config.ApplicationConfig;
import org.apache.dubbo.config.ReferenceConfig;
import org.apache.dubbo.config.RegistryConfig;

/**
 * @ClassName ClientB
 * @Description TODO
 * @Author Kristin
 * @Date 2021/06/21 16:21:11
 * @Version 1.0.0
 */
public class ClientB {

    public static void main(String[] args) {
        ReferenceConfig<GreetingService> reference = new ReferenceConfig();
        reference.setApplication(new ApplicationConfig("first-dubbo-consumer"));
        reference.setRegistry(new RegistryConfig("zookeeper://" + "127.0.0.1" + ":2181"));
        reference.setInterface(GreetingService.class);
        GreetingService service = reference.get();
        String message = service.sayHi("kristin");
        System.out.println(message);
    }

}
